<template>
  <div :style="{ 'fontSize': fontSize, 'height': fontSize, 'lineHeight': fontSize }" class="title-head">
    <el-badge v-if="isDot" :is-dot="isDot" class="title-main">{{ title }}</el-badge>
    <div v-else class="title-main ellipsis">{{ title }}</div>
    <el-tooltip v-if="tips" placement="top" effect="dark">
      <div slot="content" style="max-width: 180px; line-height: 1.5">{{ tips }}</div>
      <tipIcon is-diy style="margin-left: 8px"/>
    </el-tooltip>
    <span v-if="isShow" class="total">（共{{ total }}条记录）</span>
    <span v-if="describe" class="total">（{{ describe }}）</span>
    <slot />
  </div>
</template>
<script>
export default {
  name: 'Title',
  props: {
    title: {
      type: String,
      default: ''
    },
    isShow: {
      type: Boolean,
      default: false
    },
    total: {
      type: Number,
      default: 0
    },
    fontSize: {
      type: String,
      default: '16px'
    },
    describe: {
      type: String,
      default: ''
    },
    tips: {
      type: String,
      default: ''
    },
    isDot: {
      type: Boolean,
      default: false
    }
  }
};
</script>
<style lang="scss" scoped>
.title-head {
  color:rgba(51,51,51,1);
  flex: 1;
  align-items: center;
  display: flex;
  position: relative;
  &::before {
    position: absolute;
    content: '';
    width: 3px;
    height: inherit;
    display: inline-block;
    background-color: #406EFF;
    vertical-align: bottom;
    // position: relative;
    // top: 0px;
    // margin-right: 6px;
  }
  .right-tip{
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 14px;
    color: #999999;
    opacity: 1;
  }
  .total {
    font-size:14px;
    font-weight: bold;
    color:rgba(153,153,153,1);
    line-height:14px;
    margin-left: 4px;
  }
  .title-main {
    font-weight: bold;
    padding-left: 9px;
    max-width: 400px;
  }
}
</style>
